// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()
const db = cloud.database()

// 云函数入口函数
exports.main = async (event, context) => {

var Unit__1 = {
    pic:[1, "cloud://daanquanyou-rlnyt.6461-daanquanyou-rlnyt-1301765700/welearn/quanxinban/jinjieyingyu_zonghejiaocheng_1/a1/Snipaste_2021-03-16_09-33-39.png","cloud://daanquanyou-rlnyt.6461-daanquanyou-rlnyt-1301765700/welearn/quanxinban/jinjieyingyu_zonghejiaocheng_1/a1/Snipaste_2021-03-16_09-34-19.png",],
    text:[]
}

var Unit__2 = {
    pic:[2, "cloud://daanquanyou-rlnyt.6461-daanquanyou-rlnyt-1301765700/welearn/quanxinban/jinjieyingyu_zonghejiaocheng_1/a2/Snipaste_2021-03-16_09-35-10.png","cloud://daanquanyou-rlnyt.6461-daanquanyou-rlnyt-1301765700/welearn/quanxinban/jinjieyingyu_zonghejiaocheng_1/a2/Snipaste_2021-03-16_09-35-23.png","cloud://daanquanyou-rlnyt.6461-daanquanyou-rlnyt-1301765700/welearn/quanxinban/jinjieyingyu_zonghejiaocheng_1/a2/Snipaste_2021-03-16_09-36-25.png"],
    text:[]
}




var Unit__3 = {
    pic:[3, "cloud://daanquanyou-rlnyt.6461-daanquanyou-rlnyt-1301765700/welearn/quanxinban/jinjieyingyu_zonghejiaocheng_1/a3/Snipaste_2021-03-16_09-36-40.png","cloud://daanquanyou-rlnyt.6461-daanquanyou-rlnyt-1301765700/welearn/quanxinban/jinjieyingyu_zonghejiaocheng_1/a3/Snipaste_2021-03-16_09-36-51.png"],
    text:[]
}

var Unit__4 = {
    pic:[4, "cloud://daanquanyou-rlnyt.6461-daanquanyou-rlnyt-1301765700/welearn/quanxinban/jinjieyingyu_zonghejiaocheng_1/a4/Snipaste_2021-03-16_09-40-22.png","cloud://daanquanyou-rlnyt.6461-daanquanyou-rlnyt-1301765700/welearn/quanxinban/jinjieyingyu_zonghejiaocheng_1/a4/Snipaste_2021-03-16_09-40-33.png","cloud://daanquanyou-rlnyt.6461-daanquanyou-rlnyt-1301765700/welearn/quanxinban/jinjieyingyu_zonghejiaocheng_1/a4/Snipaste_2021-03-16_09-40-43.png"],
    text:[]
}



var Unit__5 = {
    pic:[5, "cloud://daanquanyou-rlnyt.6461-daanquanyou-rlnyt-1301765700/welearn/quanxinban/jinjieyingyu_zonghejiaocheng_1/a5/Snipaste_2021-03-16_09-40-53.png","cloud://daanquanyou-rlnyt.6461-daanquanyou-rlnyt-1301765700/welearn/quanxinban/jinjieyingyu_zonghejiaocheng_1/a5/Snipaste_2021-03-16_09-41-05.png","cloud://daanquanyou-rlnyt.6461-daanquanyou-rlnyt-1301765700/welearn/quanxinban/jinjieyingyu_zonghejiaocheng_1/a5/Snipaste_2021-03-16_09-41-13.png"],
    text:[]
}





var Unit__6 =
{
    pic:[6, "cloud://daanquanyou-rlnyt.6461-daanquanyou-rlnyt-1301765700/welearn/quanxinban/jinjieyingyu_zonghejiaocheng_1/a6/Snipaste_2021-03-16_09-41-21.png","cloud://daanquanyou-rlnyt.6461-daanquanyou-rlnyt-1301765700/welearn/quanxinban/jinjieyingyu_zonghejiaocheng_1/a6/Snipaste_2021-03-16_09-41-39.png","cloud://daanquanyou-rlnyt.6461-daanquanyou-rlnyt-1301765700/welearn/quanxinban/jinjieyingyu_zonghejiaocheng_1/a6/Snipaste_2021-03-16_09-41-47.png"],
    text:[]
}



// var Unit__7 = [7, ""]
// var Unit__8 = [8, ""]
var list = { Unit__1, Unit__2, Unit__3, Unit__4, Unit__5, Unit__6}



  db.collection("book").add({
    data:{
browse:1089,
chubanshe:"上海外语教育出版社",
list:list,
      name:"全新版大学进阶英语：综合教程第一册",
sort:"welearn",
sort1:"zonghe",
      // picture:""
      picture: "cloud://daanquanyou-rlnyt.6461-daanquanyou-rlnyt-1301765700/welearn/quanxinban/jinjieyingyu_zonghejiaocheng_1/74f3133793d2494183ea904f266c9be8.jpg"
    }
  })
  .then(res=>{
console.log(res)
  })
  .catch(err=>{
console.log(err)
  })
}
